<!DOCTYPE html>
<html>
<head>
    <title>产品二维码数据表</title>
        <#include "/header.html">
</head>
<body>
<div class="layui-card lc-admin">
		<div class="layui-card-header lc-header-admin">
			<i class="fa fa-dropbox"></i> 信息列表
		</div>
		<div class="layui-card-body lc-body-admin">
				
		<div id="myapp" v-cloak>
			<#include "/excel.html">
			<div v-show="showList">
		        <div class="grid-btn">
		        	<div class="form-group col-sm-2 lc-query">
							<input type="text" class="form-control" 
								@keyup.enter="query" placeholder="名称" v-model="params.name">
					</div>

					<a class="btn btn-default" @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
		            <div class="btn-group btn-tools">
			            <#if shiro.hasPermission("ProductionQrController:save")>
			            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			            </#if>
			            <#if shiro.hasPermission("ProductionQrController:update")>
			            <a class="btn btn-info" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			            </#if>
			            <#if shiro.hasPermission("ProductionQrController:delete")>
			            <a class="btn btn-danger" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			            </#if>
			            <#if shiro.hasPermission("ProductionQrController:generate")>
			            <a class="btn btn-facebook" @click="generate" style="margin-left: 10px;"><i class="fa fa-angle-down"></i>&nbsp;生成二维码</a>
			            </#if>
						<#if shiro.hasPermission("ProductionQrController:save")>
						<!-- 按钮触发模态框 data-toggle="modal" data-target="#myModal"-->
						<a class="btn btn-primary"  @click="openAddQrLinkMenu"  ><i class="fa fa-plus"></i>添二维码菜单</a>
						</#if>
			            <div class="btn-group" role="group" style="margin-left: 10px;">
							<button type="button" class="btn btn-success dropdown-toggle"
								data-toggle="dropdown" aria-haspopup="true"
								aria-expanded="false">
								<i class="fa fa-navicon"></i>导入/导出 <span class="caret"></span>
							</button>
							<ul class="dropdown-menu" style="min-width:110px;"> 
								<#if shiro.hasPermission("ProductionQrController:importExcel")>
					            <li><a  @click="openImportExcel"><i
										class="glyphicon glyphicon-upload"></i>&nbsp;导入</a></li>
					            </#if>
								<#if shiro.hasPermission("ProductionQrController:exportExcel")>
					            <li><a @click="exportExcel"><i
												class="glyphicon glyphicon-download"></i>&nbsp;导出</a></li>
					            </#if>
							</ul>
						</div>

		            </div>
		        </div>
		        <table id="jqGrid"></table>
		        <div id="jqGridPager" style="position: absolute; bottom: -39px;"></div>
		    </div>
		
		    <div v-show="!showList" class="panel panel-default">
		        <div class="panel-heading"><i class="fa fa-pencil-square-o"></i>{{title}}</div>
		        <form class="form-horizontal">
		            		                		            		                							                                <div class="form-group">
		                        <div class="col-sm-2 control-label">名称</div>
		                        <div class="col-sm-10">
		                            <input type="text" class="form-control" v-model="productionqr.name" placeholder="名称"/>
		                        </div>
		                    </div>
		               	 		                		            		                							                                <div class="form-group">
		                        <div class="col-sm-2 control-label">版本</div>
		                        <div class="col-sm-10">
		                            <input type="text" class="form-control" v-model="productionqr.version" placeholder="版本"/>
		                        </div>
		                    </div>
		               	 		                		            		                									                		            		                									                		            		                									                		            		                									                		            		                							                                <div class="form-group">
		                        <div class="col-sm-2 control-label">备注</div>
		                        <div class="col-sm-10">
									<textarea type="text" class="form-control" v-model="productionqr.remark" placeholder="备注"></textarea>
		                        </div>
		                    </div>
		               	 		                		            		                									                		            		            <div class="form-group">
		                <div class="col-sm-2 control-label"></div>
		                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
		                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
		            </div>
		        </form>
		    </div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true " data-keyboard="false">
	<div class="modal-dialog"  style="width: 80%;height: 80%;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="myModalLabel">
					添加二维码链接菜单
				</h4>
			</div>
			<div class="modal-body">
				<!--添加菜单-->
				<div id="categoryMenuBox" class="panel panel-default" style="margin: auto">
					<form class="form-horizontal" id="categoryMenuForm">
						<div class="form-group">
							<div class="col-sm-2 control-label">菜单名称</div>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="categoryMenuName" name="name" v-model="menu.name" placeholder="菜单名称"/>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-2 control-label">上级菜单</div>
							<div class="col-sm-10">
								<input type="text" class="form-control" value="二维码链接" disabled />
							</div>
						</div>
						<div v-if="menu.type == 1" class="form-group">
							<div class="col-sm-2 control-label">菜单URL</div>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="categoryMenuUrl" name="url" v-model="menu.url" placeholder="菜单URL" disabled/>
							</div>
						</div>
						<div v-if="menu.type != 2" class="form-group">
							<div class="col-sm-2 control-label">排序号</div>
							<div class="col-sm-10">
								<input type="number" class="form-control" id="categoryMenuOrderNum" name="orderNum" v-model="menu.orderNum" placeholder="排序号"/>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-2 control-label">图标</div>
							<div class="col-sm-10">
								<input type="text" class="form-control" name="icon"
									   placeholder="菜单图标"value="fa fa-info-circle"/>
								<code style="margin-top:4px;display: block;">获取图标：http://www.fontawesome.com.cn/faicons/</code>
							</div>
						</div>
					</form>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭
				</button>
				<button type="button" class="btn btn-primary" @click="saveQrLinkMenu">
					提交
				</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>

		</div>
	</div>
</div>
	
<script src="${ctx}webjars/static/js/modules/qr/productionqr.js?_${.now?long}"></script>
</body>
</html>